package com.qikecn.api.common;

import com.jfinal.kit.PathKit;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.generator.Generator;
import com.jfinal.plugin.c3p0.C3p0Plugin;
import net.coobird.thumbnailator.Thumbnails;

import javax.sql.DataSource;
import java.io.IOException;

/**
 * 在数据库表有任何变动时，运行一下 main 方法，极速响应变化进行代码重构
 */
public class mainTest {
	
	public static DataSource getDataSource() {
		PropKit.use("config.properties");
		C3p0Plugin c3p0Plugin = CommonConfig.createC3p0Plugin();
		c3p0Plugin.start();
		return c3p0Plugin.getDataSource();
	}
	
	public static void main(String[] args) {
		try {
			Thumbnails.of("/Users/xuezhengqin/Pictures/24G58PICNvi_1024.jpg").size(200, 300).toFile("/Users/xuezhengqin/Pictures/image_200x300.jpg");
			Thumbnails.of("/Users/xuezhengqin/Pictures/24G58PICNvi_1024.jpg").scale(0.25f).toFile("/Users/xuezhengqin/Pictures/image_25%.jpg");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}




